package com.igd.business.service;

import java.sql.SQLException;
import java.util.List;

import com.igd.exceptions.IgdException;
import com.igd.pojo.vo.PageList;
import com.igd.security.Resources;
import com.igd.security.Roles;
import com.igd.security.User;

 /**
 * @version  1.0
 *
 * @author   QIAOYU
 *
 * @date     2013-6-24
 *
 * @description	 用户信息服务类接口
 */

public interface IUserService {
	
	/**
	 * 更新用户信息
	 * 
	 * @param user
	 * 
	 * @throws IgdException
	 * 
	 * @throws SQLException 
	 */
	void updateUserInfo(User user) throws SQLException, IgdException;
	
	/**
	 * 删除废弃的用户信息
	 * 
	 * @param user
	 * 
	 * @throws SQLException
	 * 
	 * @throws IgdException
	 */
	void delUserInfo(User user) throws SQLException, IgdException;
	
	/**
	 * 持久化保存用户信息
	 * 
	 * @param user
	 * 
	 * @return
	 * 
	 * @throws SQLException
	 * 
	 * @throws IgdException
	 */
	User saveUserInfo(User user) throws SQLException, IgdException;
	
	/**
	 * 根据登录名获取用户信息
	 * 
	 * @param loginName
	 * 
	 * @return
	 * 
	 * @throws IgdException 
	 * 
	 * @throws SQLException 
	 */
	User getUserInfoByUserName(String loginName) throws SQLException, IgdException;
	
	/**
	 * 根据用户编号获取用户信息
	 * 
	 * @param Id
	 * 
	 * @return
	 * 
	 * @throws SQLException
	 * 
	 * @throws IgdException
	 */
	User getUserInfoByUserId(String Id) throws SQLException, IgdException;
	
	/**
	 * 根据用户Id获取用户角色
	 * 
	 * @param userId
	 * 
	 * @return
	 * 
	 * @throws IgdException
	 *  
	 * @throws SQLException 
	 */
	List<Roles> getUserRoleByUserId(String userId) throws SQLException, IgdException;
	
	/**
	 * 根据用户Id获取用户角色资源
	 * 
	 * @param userId
	 * 
	 * @return
	 * 
	 * @throws IgdException
	 *  
	 * @throws SQLException 
	 */
	List<Resources> getUserRoleResourceByUserId(String userId) throws SQLException, IgdException;
	
	/**
	 * 获取所有的平台用户
	 * 
	 * @param pageList
	 * 
	 * @param user
	 * 
	 * @return
	 * 
	 * @throws SQLException
	 * 
	 * @throws IgdException
	 */
	List<User> getAllUser(PageList pageList) throws SQLException, IgdException;
}
